package com.letao.server.dto;

import com.letao.server.entity.ShopInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * ES数据库存储商铺信息类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EsShopInfoDTO {
    /**
     * 自增主键
     */
    private Long id;
    /**
     * 商铺名称
     */
    private String name;
    /**
     * 商铺描述
     */
    private String descript;
    /**
     * 省Id
     */
    private Integer province_id;
    /**
     * 市Id
     */
    private Integer city_id;
    /**
     * 区Id
     */
    private Integer district_id;
    /**
     * 详细地址
     */
    private String detail;
    /**
     * 地理坐标
     */
    private String location;

    public EsShopInfoDTO(ShopInfo t) {
        this.id = t.getId();
        this.name = t.getName();
        this.descript = t.getDescript();
        this.province_id = t.getProvinceId();
        this.city_id = t.getCityId();
        this.district_id = t.getDistrictId();
        this.detail = t.getDetail();
        this.location = t.getLatitude() + ", " + t.getLongitude();
    }

}
